package com.example.springbeanlife;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @ClassName UserService
 * @Description
 * @Author Yin
 * @Date 2021/4/8 13:40
 * @Version 1.0
 */
@Component
public class UserService implements InitializingBean,UserInterface {

    @Autowired
    private User user;


    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("参数注入之后");
    }

    @PostConstruct
    public void xxx(){
        System.out.println("构造函数之后");
    }

    @Override
    public void test() {
        System.out.println("实现test方法");
    }
}
